type Replace<
  S extends string,
  From extends string,
  To extends string
> = S extends `${infer F}${From}${infer L}`
  ? `${F}${From extends "" ? "" : To}${L}`
  : S;
